package com.ruoyi.project.common;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
    * 发码开放平台
    *
    * @author 512
    */
@Api("健阵保险卡核销开放平台")
@RestController
@RequestMapping("/card/openapi/v1")
public class OpenAPIController extends BaseController {



    /**
     * 健阵保险卡核销
     * 用于消费核销
     * @param baseParam
     * @return
     */
    @PostMapping("/ticketcode/use")
    @ApiOperation(value = "卡核销-用于消费核销",response = String.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name="app_key", value = "商家应用app_key",required = true, paramType = "query"),
            @ApiImplicitParam(name="sign", value = "签名", required = true, paramType = "query"),
            @ApiImplicitParam(name="timeStamp", value = "时间戳",required = true, paramType = "query"),
            @ApiImplicitParam(name="ticketcode", value = "卡片序列号",required = true, paramType = "query"),
            @ApiImplicitParam(name="dynamicPassword", value = "核销动态密码,用户手机验证码",required = true, paramType = "query"),
            @ApiImplicitParam(name="orderDetails", value = "消费明细json串（门店信息，商品信息）",required = true, paramType = "query")
    })
    @ApiResponses({
            @ApiResponse(code = 1, message = "操作成功"),
            @ApiResponse(code = 0, message = "操作失败"),
            @ApiResponse(code = 10001, message = "参数错误"),
            @ApiResponse(code = 11001, message = "无效的app_key"),
            @ApiResponse(code = 11002, message = "签名错误或已失效"),
            @ApiResponse(code = 11003, message = "无效的签名"),
    })
    public AjaxResult ticketcodeUse(String baseParam) {

        return AjaxResult.success();
    }

    /**
     * 健阵保险卡核销记录
     * 用于商家查询消费核销记录账单
     * @param baseParam
     * @return
     */
    @PostMapping("/ticketcode/use/record")
    @ApiOperation(value = "卡核销记录-用于商家查询消费核销记录账单",response = String.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name="app_key", value = "商家应用app_key",required = true, paramType = "query"),
            @ApiImplicitParam(name="sign", value = "签名", required = true, paramType = "query"),
            @ApiImplicitParam(name="timeStamp", value = "时间戳",required = true, paramType = "query"),
            @ApiImplicitParam(name="checkStatus", value = "对账结算状态：0-全部，1-未结算，2-已结算",required = true, paramType = "query"),
            @ApiImplicitParam(name="startTime", value = "开始时间（如：2020-09-10）,不传时间默认返回当月的记录",required = false, paramType = "query"),
            @ApiImplicitParam(name="endTime", value = "结束时间（如：2020-09-10）",required = false, paramType = "query")
    })
    @ApiResponses({
            @ApiResponse(code = 1, message = "操作成功"),
            @ApiResponse(code = 0, message = "操作失败"),
            @ApiResponse(code = 10001, message = "参数错误"),
            @ApiResponse(code = 11001, message = "无效的app_key"),
            @ApiResponse(code = 11002, message = "签名错误或已失效"),
            @ApiResponse(code = 11003, message = "无效的签名"),
    })
    public AjaxResult ticketcodeRecord(String baseParam) {

        return AjaxResult.success();
    }


}
